package time;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;

public class HospitalDateTest
{
	@Test
	public void Constructor0Test() {
		HDate h = new HDate();
		assertTrue(h.getYear() == HDate.START_YEAR);
		assertTrue(h.getMonth() == HDate.START_MONTH);
		assertTrue(h.getDay() == HDate.START_DAY);
		assertTrue(h.getHour() == HDate.START_HOUR);
		assertTrue(h.getMinute() == HDate.START_MINUTE);
		assertTrue(h.getSecond() == HDate.START_SECOND);
	}

	@Test
	public void Constructor1Test() {
		HDate h = new HDate(1000000);
		assertTrue(h.getTimeSinceStart() == 1000000);
	}

	@Test
	public void cloneTest() {
		HDate h = new HDate(1000000);
		assertTrue(h.equals(h.clone()));

	}

	@Test
	public void setTimeTest() {
		HDate h = new HDate(2011, 11, 11, 11, 11, 11);
		assertTrue(h.getYear() == 2011);
		assertTrue(h.getMonth() == 11);
		assertTrue(h.getDay() == 11);
		assertTrue(h.getHour() == 11);
		assertTrue(h.getMinute() == 11);
		assertTrue(h.getSecond() == 11);
	}

	@Test
	public void toStringTest() {
		System.out.println(new HDate(0));
	}

	@Test
	public void beforeTest() {
		HDate h0 = new HDate(1000);
		HDate h1 = new HDate(1000);
		HDate h2 = new HDate(1001);
		assertFalse(h0.before(h1));
		assertTrue(h0.before(h2));
		assertFalse(h2.before(h0));
	}
}